import re

s = input()
s += ' '
words = []
ans4 = 0
ans5 = 0
ans60 = ''
ans61 = 0

for i in range(len(s)):
    if s[i] != ' ':
        s1 = s[i]
    else:
        if s1 != '':
            words.append(s1)
            if len(s1) <= 3:
                ans4 += 1
            if '-' in s1:
                ans5 += 1
            if i == 0 or len(s1) > ans61:
                ans60 = s1
                ans61 = len(s1)
            s1 = ''

ans1 = len(words)
ans2 = sum(1 for word in words if word[0].isupper())
ans3 = sum(1 for word in words if any(c.isalpha() for c in word))

if ans1 == 0 or ans1 == 1:
    print("Мало данных для анализа")
else:
    print(ans1)
    print(ans2)
    print(ans3)
    print(ans4)
    print(ans5)
    print()
    print(ans60)
    print(ans61)